package com.arnold.demo.journal.entity

import scala.util.Random

/**
  * Created by arnold.zhu on 2017/7/20.
  */
case class Invoice(iid: String, date: String, value: Double, itype: String, snumber: String, errcode: String, istatus: String) extends Serializable {

  private val id = iid
  private val invoiceId = Random.nextInt(100000)
  private val invoiceDate = date
  private val invoiceValue = value
  private val invoiceType = itype
  private val storeNumber = snumber
  private val status = istatus
  private val errorCode = errcode
  private val error_type = ""
  private val error_desc = ""

  def this(id: String, date: String, value: Double, itype: String, snumber: String) = {
    this(id, date, value, itype, snumber, "00", "1")
  }

  def id_(): String = {
    id
  }

  def invoiceId_(): String = {
    invoiceId.toString
  }

  def invoiceDate_(): String = {
    date
  }

  def invoiceValue_(): Double = {
    invoiceValue
  }

  def invoiceType_(): String = {
    invoiceType.toString
  }

  def storeNumber_(): String = {
    storeNumber
  }

  def status_(): String = {
    status.toString
  }

  def errorCode_(): String = {
    errorCode
  }

  def error_type_(): String = {
    error_type
  }

  def error_desc_(): String = {
    error_desc
  }

  override def toString = s"Invoice($invoiceId, $invoiceDate, $invoiceValue, $invoiceType, $storeNumber, $status, $errorCode)"
}
